package com.powernode.feign.sentinel;

import com.alibaba.fastjson.JSON;
import com.powernode.constant.BusinessEnum;
import com.powernode.domain.Prod;
import com.powernode.feign.StoreProdFeign;
import com.powernode.model.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 门店业务模块调用商品业务模块的熔断处理
 */
@Component
@Slf4j
public class StoreProdFeignSentinel implements StoreProdFeign {

    @Override
    public Result<List<Prod>> getProdListByIds(List<Long> ids) {
        log.error("远程调用商品模块：根据商品ids查询商品对象集合失败，参数:{}", JSON.toJSON(ids));
        return Result.fail(BusinessEnum.OPERATION_FAIL);
    }
}
